#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys, os
dirpath = os.path.dirname(os.path.abspath(__file__))
sys.path.append(dirpath)
sys.path.append(os.path.join(dirpath, '../'))
from htmlparser2 import MultiTagParser

htmlbody="""
<html>
<title>test</title>
<body>
<input type="hidden" name="JP" value="Japan"/>
<input type="hidden" name="China"/>
<input type="hidden" />
<input type="checkbox" name="US" value="United States"/>
</body>
</html>
"""


#条件設定
cond = {}
cond["type"] = "hidden"

parser = MultiTagParser([('input', {'type':'hidden'}), ('input', {'type':'checkbox'}), ])
parser.feed(htmlbody)
parser.close()

print "Name:Value"
print parser.get_dict_name_value()

print 
print 
print "RESULT:"
print parser.RESULT
